let myDictionary = {
    "key1": "value1",
    "key2": "value2",
    "key3": "value3"
};

console.log(myDictionary["key1"]); // 输出"value1"
console.log(myDictionary.key2); // 输出"value2"


for (let key in myDictionary) {
    console.log(key + ": " + myDictionary[key]);
}


const map = new Map();
map.set('name', 'Tom');
map.set('age', 18);
console.log(map.get('name')); // Tom
console.log(map.has('age')); // true
map.delete('age');
console.log(map.size); // 1


const arr = [1, 2, 3, 4, 5];
const sum = arr.reduce((acc, cur) => acc + cur, 0);
console.log(sum); // 15


// const arr = [1, 2, 3, 4, 5];
// const evenArr = arr.filter((item) => item % 2 === 0);
// console.log(evenArr); // [2, 4]


// const arr = [1, 2, 3, 4, 5];
// arr.forEach((item, index, array) => {
//     console.log(item, index, array);
// });


// const arr = [1, 2, 3, 4, 5];
// const hasEven = arr.some((item) => item % 2 === 0);
// console.log(hasEven); // true


// const arr = [1, 2, 3, 4, 5];
// const allEven = arr.every((item) => item % 2 === 0);
// console.log(allEven); // false


